using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class So_RecallWeekMap : EntityTypeConfiguration<So_RecallWeek>
    {
        public So_RecallWeekMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID, t.Date, t.Status });

            // Properties
            this.Property(t => t.ID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Patient__)
                .HasMaxLength(6);

            this.Property(t => t.Patient_Name)
                .HasMaxLength(50);

            this.Property(t => t.Procedure)
                .HasMaxLength(50);

            this.Property(t => t.Physician)
                .HasMaxLength(35);

            this.Property(t => t.Phone)
                .HasMaxLength(19);

            this.Property(t => t.Email)
                .HasMaxLength(50);

            this.Property(t => t.Status)
                .IsRequired()
                .HasMaxLength(9);

            // Table & Column Mappings
            this.ToTable("So_RecallWeek");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Patient__).HasColumnName("Patient_#");
            this.Property(t => t.Patient_Name).HasColumnName("Patient_Name");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Recall_Date).HasColumnName("Recall_Date");
            this.Property(t => t.Procedure).HasColumnName("Procedure");
            this.Property(t => t.Physician).HasColumnName("Physician");
            this.Property(t => t.Phone).HasColumnName("Phone");
            this.Property(t => t.Email).HasColumnName("Email");
            this.Property(t => t.Status).HasColumnName("Status");
        }
    }
}
